<?php
use Swoole\Http\Server;

$http = new Server("0.0.0.0", 8811);
$http->set([
    'document_root' => '/home/www/swoole_live/public/static',
    'enable_static_handler' => true,
]);
$http->on('request', function ($request, $response) {
	$response->cookie("swoole", "erere", time() + 1800);
    $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>");
});
$http->start();